{# 翻页的代码片段,适用于Jinja模板,需要变量: page, Paginator对象 #}
<div class="pagination pagination-centered">
    <ul class="pagination pagination-centered">

        <li {% if page.number == 1 %}class="disabled"{% endif %}>
            <a href="?page=1&{{ page.queries }}">首页</a>
        </li>

        {% if page.has_previous() %}
            <li><a href="?page={{ page.previous_page_number() }}&{{ page.queries }}">上一页</a></li>
        {% else %}
            <li class="disabled"><a>上一页</a></li>
        {% endif %}

        <li class="disabled">
            <a>page {{ page.number }} of {{ page.paginator.num_pages }}</a>
        </li>

        {% if page.has_next() %}
            <li><a href="?page={{ page.next_page_number() }}&{{ page.queries }}">下一页</a></li>
        {% else %}
            <li class="disabled"><a>下一页</a></li>
        {% endif %}

        <li {% if not page.has_next() %}class="disabled"{% endif %}>
            <a href="?page={{ page.paginator.num_pages }}&{{ page.queries }}">尾页</a>
        </li>

    </ul>
</div>
